import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import store from './vuex/store'
import '@/plugins/element'
import request from '@/common/js/request'

Vue.config.productionTip = false
let prefix = process.env.NODE_ENV === 'development' ? '/local' : '/'
Vue.prototype.$http = request
Vue.prototype.$uploadurl = prefix + '/personal/common/upload'
Vue.prototype.$uploadhost = prefix

Vue.prototype.$filehost = process.env.NODE_ENV === 'development' ? '/local' : '/'
Vue.filter('checkurl', val => {
  if (val.indexOf('http') !== 0) {
    return (process.env.NODE_ENV === 'development' ? '/local' : '/') + val
  }
  return val
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
